<!DOCTYPE html>
<html>

<head>
	<title>Page Break Test</title>
	<link rel="stylesheet" type="text/css" href="examples.css">
	<style>
		table,
		td {
			border: 1px solid silver;
			border-collapse: collapse
		}

		td {
			padding: .5em
		}
	</style>
</head>

<body>
	<div id="html" style='position: absolute; left: 0; top: 0; bottom: 0; overflow: auto; width: 400px'>
		This example show how the <em>page-break-before</em> style is rendered.

		<h1 style='page-break-before: always'>Numbers</h1>
		<p>1</p>
		<p>2</p>
		<p>3</p>
		<p>4</p>

		<h1 style='page-break-before: always'>Letters</h1>
		<p>a</p>
		<p>b</p>
		<p>c</p>
		<p>d</p>

		<h1 style='page-break-before: always'>Text</h1>
		<p>This is the content.</p>

	</div>

	<script src="https://html2canvas.hertzen.com/dist/html2canvas.js"></script>
	<script src='../../dist/jspdf.debug.js'></script>
	<script>
		var pdf = new jsPDF('p', 'pt', 'letter');

		pdf.html(document.getElementById('html'), {
			callback: function (pdf) {
				var iframe = document.createElement('iframe');
				iframe.setAttribute('style', 'position:absolute;right:0; top:0; bottom:0; height:100%; width:500px');
				document.body.appendChild(iframe);
				iframe.src = pdf.output('datauristring');
			}
		});
	</script>
</body>

</html>